#include <iostream>
#include <memory>

class Subject
{
public:
    virtual void request() = 0;
    virtual ~Subject(){};
};

class RealSubject: public Subject
{
public:
    void request(){
        std::cout << " This is a real subject." << std::endl;
    }
};

class Proxy: public Subject
{
private:
    RealSubject* m_real_subject;

public:
    Proxy(RealSubject* real_subject):m_real_subject(real_subject){}
    void request(){
        m_real_subject->request();
    }

};



int main(int argc, char const *argv[])
{
    std::unique_ptr<RealSubject> real_subject(new RealSubject());

    std::unique_ptr<Proxy> proxy(new Proxy(real_subject.get()));
    proxy->request();

    return 0;
}
